package com.nari.kmd_dataservice.util;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @ClassName: LocalDateTimeUtil
 * @Description:
 * @Author: zhangnaijiang
 * @Date: 2022/01/22 17:25
 * @Version 1.0.0
 */
public class LocalDateTimeUtil {

    private LocalDateTimeUtil() {
    }
    /**
     * 获取时间格式
     * @param date
     * @param dateFormat
     * @return
     */
    public static String getDateString(Date date, String dateFormat) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
        String formatStr = simpleDateFormat.format(date);
        return formatStr;
    }
}
